<template>
	<view class="container">
		<image class="bg-img" :src="$IMAGE_BASE_URL3 + '/bg_notice.jpg'"></image>
		<view class="title">吸氧体验注意事项</view>
		<view class="notice">
			<view class="notice-title">体验注意事项</view>
			<view class="notice-list">
				<view class="notice-list-item">01 禁止携带小刀、钢笔等尖锐物品、以及携带火种， 打火机、充电宝等易燃易爆品进入舱内。</view>
				<view class="notice-list-item">02 在舱内加压时适当做捏鼻子鼓气或吞咽、咀嚼、打 哈、张口闭口等动作，可缓解不适症状。</view>
				<view class="notice-list-item">03 进舱前建议先去下洗手间，在氧舱内不宜大量饮水</view>
				<view class="notice-list-item">04 感觉不适或要提前出舱，请按铃联系服务人员</view>
				<view class="notice-list-item">05 如有特殊情况需要紧急出舱时，可轻按手动泄压阀 达到减压作用。</view>
			</view>
			<view class="tip" @click="onTip">
				<label>
					<checkbox :checked="isChecked" color="#f7620c" style="transform:scale(0.7)" />
					以上事项已阅，并已清楚，如有隐瞒本公司不承担任何法律责任。
				</label>
			</view>
			<view class="btn" @click="onConfirm">已知晓</view>
		</view>
	</view>
</template>

<script>
	import {
		showInfo
	} from '@/utils/ToastUtils';
	import CacheConfig from '@/config/CacheConfig';
	import StorageUtils from '@/utils/StorageUtils';
	import * as ReservationApi from '@/api/reservation/index.js';

	export default {
		data() {
			return {
				isChecked: false
			};
		},
		methods: {
			onTip() {
				this.isChecked = !this.isChecked;
			},
			onConfirm() {
				if (!this.isChecked) {
					showInfo("请阅读以上体验事项后，勾选确认");
					return;
				}
				const param = StorageUtils.get(CacheConfig.OXYGEN_INFO);
				console.log("氧舱登录 param", param);
				ReservationApi.bindDevice(param).then(res => {
					showInfo("绑定成功");
					uni.navigateBack();
				}).catch(err => {
					console.log("bindDevice error", err);
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		width: 100vw;
		height: 100vh;
		position: relative;

		.bg-img {
			width: 100%;
			height: 100%;
			position: absolute;
			left: 0;
			top: 0;
			z-index: 1;
		}

		.title {
			font-size: 75rpx;
			color: #ffe6d3;
			font-weight: bold;
			text-align: center;
			position: relative;
			z-index: 2;
			text-shadow: 20rpx 0 30rpx #f7620c;
			padding: 140rpx 0 120rpx 0;
		}

		.notice {
			position: relative;
			z-index: 2;
			width: 700rpx;
			height: 915rpx;
			border-radius: 30rpx;
			background-color: #fff;
			padding: 0 20rpx;
			margin: 0 auto;
			box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.2);

			.notice-title {
				padding-top: 25rpx;
				font-size: 36rpx;
				color: #f7620c;
				font-weight: bold;
			}

			.notice-list {
				margin-top: 15rpx;

				.notice-list-item {
					width: 100%;
					height: 114rpx;
					border-radius: 10rpx;
					background-color: #feecdd;
					margin-bottom: 12rpx;
					display: flex;
					align-items: center;
					padding: 0 15rpx;
					box-sizing: border-box;
					font-weight: bold;
				}

				.notice-list-item:last-child {
					margin-bottom: 0;
				}
			}

			.tip {
				margin-top: 25rpx;
				font-size: 20rpx;
				font-weight: bold;
				color: #f7620c;
				display: flex;
				align-items: center;
			}

			.btn {
				width: 159rpx;
				height: 56rpx;
				border-radius: 56rpx;
				background-color: #f7620c;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 30rpx;
				color: #fff;
				font-weight: bold;
				margin: 38rpx auto;
			}
		}
	}
</style>